﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {
            ArrayList list = new ArrayList() { "aaa", "bbb", "abc", 123, 456 };

            ArrayList list1 = new ArrayList() {  15523, 57456 };

            //     list.Add(10); //添加元素10

            //     list.AddRange(list1); //添加集合list1

            //      list.Clear(); //清空集合

            // list.Remove("bbb"); //移除bbb

             //   list.RemoveAt(0); //移除下标为0的元素



            list1.Sort(); //小到大排序

            foreach(var v in list1)
            {
                Console.WriteLine(v);
            }


            //寻找，定位
            int index = list.IndexOf("aaa");
            if(index!=-1)
            {
                int v = list.IndexOf("aaa");
                Console.WriteLine("aaa存在"+"下标为"+v);
            }
            else
            {
                Console.WriteLine("不存在");
            }

            //判断是否存在
            Console.WriteLine(list.Contains("aaa"));


           
        }
    }
}
